package com.car.loan.project.xr.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Collection;
import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.car.loan.project.xr.mapper.LoanExtMapper;
import com.car.loan.project.xr.domain.LoanExt;
import com.car.loan.project.xr.service.ILoanExtService;

/**
 * 车贷逾期Service业务层处理
 *
 * @author ruoyi
 * @date 2019-11-03
 */
@Service
public class LoanExtServiceImpl implements ILoanExtService {

    @Autowired
    private LoanExtMapper loanExtMapper;

    /**
     * 查询车贷逾期
     *
     * @param id 车贷逾期ID
     * @return 车贷逾期
     */
    @Override
    public LoanExt selectLoanExtById(Long id) {
        return loanExtMapper.selectById(id);
    }

    /**
     * 查询车贷逾期列表
     *
     * @param loanExt 车贷逾期
     * @return 车贷逾期
     */
    @Override
    public List<LoanExt> selectLoanExtList(LoanExt loanExt) {
        QueryWrapper<LoanExt> queryWrapper = new QueryWrapper<>(loanExt);
        return loanExtMapper.selectList(queryWrapper);
    }


    @Override
    public IPage<LoanExt> selectPage(IPage<LoanExt> page, QueryWrapper<LoanExt> queryWrapper) {
        return loanExtMapper.selectPage(page, queryWrapper);
    }

    /**
     * 新增车贷逾期
     *
     * @param loanExt 车贷逾期
     * @return 结果
     */
    @Override
    public int insertLoanExt(LoanExt loanExt) {

        return loanExtMapper.insert(loanExt);
    }

    /**
     * 修改车贷逾期
     *
     * @param loanExt 车贷逾期
     * @return 结果
     */
    @Override
    public int updateLoanExt(LoanExt loanExt) {

        return loanExtMapper.updateById(loanExt);
    }

    /**
     * 删除车贷逾期对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLoanExtByIds(Collection<Long> ids) {
        return loanExtMapper.deleteBatchIds(ids);
    }

    /**
     * 删除车贷逾期信息
     *
     * @param id 车贷逾期ID
     * @return 结果
     */
    @Override
    public int deleteLoanExtById(Long id) {
        return loanExtMapper.deleteById(id);
    }
}
